#include "stm32f10x.h"
#include "exti.h"

void EXTI1_Config(void)
{
	RCC->APB2ENR |= (1<<2);
	RCC->APB2ENR |= (1<<0);
	GPIOA->CRL &=~(0xf<<0);
	GPIOA->CRL |= (0x4<<0);
	AFIO->EXTICR[0] &=~(0xf<<0);
	EXTI->FTSR |= (1<<0);
	EXTI->IMR  |= (1<<0);
	NVIC_SetPriority(EXTI0_IRQn,5);
	NVIC_EnableIRQ(EXTI0_IRQn);
}
u8 exti0_flag = 0;
void EXTI0_IRQHandler(void)
{
	if(EXTI->PR & (1<<0))
	{
		EXTI->PR |= (1<<0);
		exti0_flag =1;
	}
}




